/**
 *
 */

var app = getApp()
Page({
	data: {
		root:'',
		siteroot:app.setting.siteroot,
		att_url:app.setting.att_url,
		member:[],
		avatar:'',
		pagetitle:'修改头像',
		bannerHeight: Math.ceil(290.0 / 750.0 * getApp().screenWidth)
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (options){
		var that =this
		wx.setNavigationBarTitle({'title':that.data.pagetitle});
		app.util.get(app.access,function(res){
			if (!res.errno) {
			  that.setData({
					pagedata: res,
			  })
			}
		});
	},
	up_image:function(){
		var the =this
		var pagedata = the.data.pagedata
		app.util.image(function(res){
			res=the.data.att_url+res;
			the.setData({
				'pagedata.item.avatar': res,
			})	
		});
	},
	//提交订单
    formSubmit:function(e){
		var data=e.detail.value;
        var that = this;
		var pagedata =that.data.pagedata
		pagedata.item.nickname=data.nickname
        wx.showToast({
            title: '加载中',
            icon: 'loading',
            duration: 1000,
            mask:true
        });
		app.util.post('post',pagedata.item);
    },

})